<!DOCTYPE HTML>
<html>
<head>
  <title>iframe.src changes to unsecure redirect test</title>
  <script type="text/javascript" src="/MochiKit/Base.js"></script>
  <script type="text/javascript" src="/MochiKit/DOM.js"></script>
  <script type="text/javascript" src="/MochiKit/Style.js"></script>
  <script type="text/javascript" src="/MochiKit/Signal.js"></script>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="text/javascript" src="mixedContentTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />

  <script class="testbody" type="text/javascript">
  /* import-globals-from mixedContentTest.js */
  "use strict";

  hasMixedActiveContent = true;

  function runTest()
  {
    isSecurityState("secure");
    let self = window;
    let iframe = document.getElementById("iframe1");
    iframe.onload = function() {
      self.isSecurityState("broken", "src='redirect to unsecure' changed to broken");
      self.finish();
    };

    iframe.src =
      "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs";
  }

  function afterNavigationTest()
  {
    isSecurityState("broken", "security still broken after navigation");
    finish();
  }

  </script>
</head>

<body>
  <iframe id="iframe1" src="https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/iframe.html"></iframe>
</body>
</html>
